<template>
  <el-dialog title="导入结果" :visible.sync="resultVisible">
    <div class="result-content">
      <div ><span class="el-icon-success" style="font-size: 30px; color: #67c23a"></span></div>
      <div class="item">导入完成！</div>
      <div class="item">共{{totalCnt}}条，成功{{totalCnt - failtrueCnt}}条，失败{{failtrueCnt}}条！</div>
      <div class="item" v-show="failtrueCnt">下载错误报告，查看失败原因！</div>
      <div class="" v-show="failtrueCnt">
        {{result}}
        <el-button type="text" @click="downResult">下载</el-button>
      </div>
    </div>
    <div slot="footer">
      <nb-button large type="plain"  @click="resultVisible = false">关闭</nb-button>
    </div>
  </el-dialog>
</template>

<script>
  import Mixin from '@/common/mixin'
  export default {
    data () {
      return {
        resultVisible: false
      }
    },
    props: {
      totalCnt: {
        type: [Number, String],
        default: 0
      },
      failtrueCnt: {
        type: [Number, String],
        default: 0
      },
      result: String
    },
    mixins: [Mixin],
    methods: {
      show () {
        this.resultVisible = true
      },
      downResult () {
        this.download('/http/common/download.json?data=', {value: this.result})
      }
    },
    mounted () {
    }
  }
</script>

<style lang="scss">

</style>
